import React, { Component } from 'react'
import { Button, CoverImage, CoverView } from '@tarojs/components'

import {  getFullSrcs } from '@/utils/Helper'
import styles from './index.module.scss'




const menuList = [{
  title:'园区',
  iconPath:getFullSrcs('documents/yuanqu0.png'),
  selectedIconPath:getFullSrcs('documents/yuanqu1.png'),
},{
  title:'资本',
  iconPath:getFullSrcs('documents/ziben0.png'),
  selectedIconPath:getFullSrcs('documents/ziben1.png'),
},{
  title:'人才',
  iconPath:getFullSrcs('documents/rencai0.png'),
  selectedIconPath:getFullSrcs('documents/rencai1.png')
},{
  title:'技术',
  iconPath:getFullSrcs('documents/jishu0.png'),
  selectedIconPath:getFullSrcs('documents/jishu1.png')
},{
  title:'数据',
  iconPath:getFullSrcs('documents/shuju0.png'),
  selectedIconPath:getFullSrcs('documents/shuju1.png')
}
// ,{
//   title:'个人中心',
//   iconPath:getFullSrcs('shop/manager.png'),
//   selectedIconPath:getFullSrcs('shop/select-manager.png')
// }
]

export default class Index extends Component<any, any> {
  render() {
    return (
      <CoverView className={styles['bottom-menus']}>
        {menuList.map((item, index) => {
          return (
            <CoverView
              key={index}
              onClick={() => {
                this.props.onMenuClick(index)
              }}
              className={styles['view-con']}
            >
              {Number(this.props.checkedMenu || '0') === index?
                <CoverImage  className={styles.icon} src={item.selectedIconPath} />
                :
                <CoverImage  className={styles.icon}  src={item.iconPath} />
              }
              <Button
                className={Number(this.props.checkedMenu || '0') === index ? styles['checked'] : styles['unChecked']}
              >
                {item.title}
              </Button>
            </CoverView>

          )
        })}
      </CoverView>
    )
  }
}
